package com.guandi.geekbrowser.primary.service;

import com.guandi.geekbrowser.primary.entity.Details;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;

import java.util.List;
import java.util.Optional;

public interface DetailsService {

    List<Details> findAll();

    void saveDetails(Details details);

    void saveDetailList(List<Details> detailsList);

    List<Details> findByTabName(String name);

    List<Details> findByTabNameAndUserId(String name, String id);

    Optional<Details> findById(Long detailId);

    Details findByIdAndUserId(Long detailId,String id);

    Integer deleteAllByTabNameAndUserId(String tabName,String userId);

    Integer deleteByIdAndUserId(Long id,String userId);

    void updateOne(String name,Long id,String userId);

    List<Details> findByRegIp(String ip);

    Details findByIdAndUserIdQuery(Long detailId,String id);

    List<Details> findByTabNameAndUserIdQuery(String tabName, String UserId);

    Integer updateRegister(Long id,boolean register);

    Integer updatePassword(Long id,String password,String uid);

    Integer updatePcCookie(Long id,String pcCookie,String uid);

    Page<Details> findAllPageByTabNameAndUserId(String tabName,String userId,int pageNumber,int pageSize);

    Page<Details> findAllPageByTabNameAndUserIdAndCountry(String tabName,String userId,int pageNumber,int pageSize,String country,String searchWord,Integer type);

    void deleteAll(List<Details> details);

    List<Details> findByUserId(String userId);

    Page<Details> findByUserIdQuery(String userId,int pageSize,int pageNumber);

    List<Details> findByTabNameAndUserIdAndCountryQuery(String tabName, String UserId,String country);

    List<Details> findByRegIpAndCountry(String ip,String country);

    Details findByIdAndUserIdAndCountry(Long id,String userId,String country);

    List<Details> findByUserIdAndCountry(String id,String country);

    List<Details> findByUserIdAndCountryQuery(String id,String country);

    Integer deleteAllByTabNameAndUserIdAndCountry(String tabName,String userId,String country);

    List<Details> findByUserIdAndCountryAndType(String id,String country,Integer type);
}
